<?php
/**
 * author      :chenwenwen
 * createTime  :2020-04-12 23:39
 * description :
 */

namespace app\common\lib;
class ClassArr {
    public static function smsClassStat() {
        return [
            'ali' => 'app\common\lib\sms\AliSms',
        ];
    }

    public static function initClass($type, $classes, $params = [], $needInstance = false) {
        if (!array_key_exists($type, $classes)) return false;
        $className = $classes[$type];
        return $needInstance == false ? (new \ReflectionClass($className))->newInstanceArgs($params):$className;
    }
}